package com.itheima.d4_printstream;

import java.io.FileNotFoundException;
import java.io.PrintStream;
import java.io.PrintWriter;

public class PrintTest2 {
    public static void main(String[] args) {
        System.out.println("hellp");
        System.out.println("faaaf");

        try (
                PrintStream ps = new PrintStream("Day18-io-app\\src\\itheimaOut06.txt");
                ){
            System.setOut(ps);

            System.out.println("fafaw");
            System.out.println("sgsg");

        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
